package Fanxiang;
public class SplitString {

	public static String spilt(String s, int start, int end) {
		char[] str = stringToCharArray(s);
		if (str == null || str.length == 0 || start < 0 || end > s.length())
			return "";

		char[] result = new char[end - start];
		int i = 0;
		while (start < end) {
			result[i++] = str[start++];
		}

		return new String(result);
	}

	public static char[] stringToCharArray(String str) {
		if (str == null || str.equals(""))
			return null;

		char[] arr = new char[str.length()];
		for (int i = 0; i < str.length(); i++) {
			arr[i] = str.charAt(i);
		}
		return arr;
	}
}

